*** Create Figure 2: Effects of Frames and sourcing

		** 1. section: Effects of Russian Frame only
		** 2. section: Effects of Western Frame only
		** 3. section: Effects of Russian Frame + Sourcing
		** 4. section: Effects of Western Frame + Sourcing
		** 5. section: Plot matrix

use data_long.dta, clear


*Define locals

local controls1 "age female educ_secondary educ_prof_high educ_acad_high i.exp"
local controls2a "authoritarian conspiracy_sum	know_sum	pred_bundes_gov_r	pred_Russia_r	" // for total sample
local controls2b "				conspiracy_sum	know_sum	pred_bundes_gov_r	pred_Russia_r	" // for for authoritarian beliefs
local controls2c "authoritarian					know_sum	pred_bundes_gov_r	pred_Russia_r	" // for conspiracy beliefs
local controls2d "authoritarian conspiracy_sum				pred_bundes_gov_r	pred_Russia_r	" // for knowledge
local controls2e "authoritarian conspiracy_sum know_sum 						pred_Russia_r	" // for att twd German gov
local controls2f "authoritarian conspiracy_sum know_sum		pred_bundes_gov_r					" // for att twd Russia


***************************************************

*** Section 1: Effects of Russian Frame only

***************************************************

matrix matrix1_all = J(11,3,.) // 3 column for lower ci, estimate, upper ci

*Average effect, all experiments
mixed poolexp i.treat_exp `controls1' `controls2a' || lfdn:
mat r=r(table)
matrix list r // show what is in the r matrix to be able to specify what we want to extract
matrix matrix1_all[1, 1] = r[1,2] // Note: first number in bracket references the row, the second the column
matrix matrix1_all[1, 2] = r[5,2]
matrix matrix1_all[1, 3] = r[6,2]
matrix list matrix1_all // show target matrix to check if everything worked

*By authoritarian beliefs, all experiments
mixed poolexp i.treat_exp##c.authoritarian  `controls1' `controls2b' || lfdn:
margins, dydx(2.treat_exp) at(authoritarian=(.83 .29)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_all[2, 1] = r[1,3] // authoritarianism high
matrix matrix1_all[2, 2] = r[5,3]
matrix matrix1_all[2, 3] = r[6,3]
matrix matrix1_all[3, 1] = r[1,4] // authoritarianism low
matrix matrix1_all[3, 2] = r[5,4]
matrix matrix1_all[3, 3] = r[6,4]
matrix list matrix1_all

*By conspiracy theory beliefs, all experiments
mixed poolexp i.treat_exp##c.conspiracy_sum `controls1' `controls2c' || lfdn:
margins, dydx(2.treat_exp) at(conspiracy_sum=(.8 .05)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_all[4, 1] = r[1,3] // high conspiracy theory score
matrix matrix1_all[4, 2] = r[5,3]
matrix matrix1_all[4, 3] = r[6,3]
matrix matrix1_all[5, 1] = r[1,4] // low conspiracy theory score
matrix matrix1_all[5, 2] = r[5,4]
matrix matrix1_all[5, 3] = r[6,4]
matrix list matrix1_all

*By political knowledge, all experiments
mixed poolexp i.treat_exp##c.know_sum `controls1' `controls2d' || lfdn:
margins, dydx(2.treat_exp) at(know_sum=(0 .875)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_all[6, 1] = r[1,3] // high political knowledge
matrix matrix1_all[6, 2] = r[5,3]
matrix matrix1_all[6, 3] = r[6,3]
matrix matrix1_all[7, 1] = r[1,4] // low political knowledge
matrix matrix1_all[7, 2] = r[5,4]
matrix matrix1_all[7, 3] = r[6,4]
matrix list matrix1_all

*By attitudes toward German government, all experiments
mixed poolexp i.treat_exp##c.pred_bundes_gov_r `controls1' `controls2e' || lfdn:
margins, dydx(2.treat_exp) at(pred_bundes_gov_r=(0 .9)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_all[8, 1] = r[1,3] // government opponents
matrix matrix1_all[8, 2] = r[5,3]
matrix matrix1_all[8, 3] = r[6,3]
matrix matrix1_all[9, 1] = r[1,4] // government supporters
matrix matrix1_all[9, 2] = r[5,4]
matrix matrix1_all[9, 3] = r[6,4]
matrix list matrix1_all

*By attitudes toward Russia, experiments on foreign policy
mixed poolexp i.treat_exp##c.pred_Russia_r `controls1' `controls2f' || lfdn:
margins, dydx(2.treat_exp) at(pred_Russia_r=(.8 .0 )) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_all[10, 1] = r[1,3] // positive attitude toward Russia 
matrix matrix1_all[10, 2] = r[5,3]
matrix matrix1_all[10, 3] = r[6,3]
matrix matrix1_all[11, 1] = r[1,4] // negative attitude toward Russia  
matrix matrix1_all[11, 2] = r[5,4]
matrix matrix1_all[11, 3] = r[6,4]
matrix list matrix1_all


***************************************************

*** Section 2: Effects of Western Frame only

***************************************************

matrix matrix2_all = J(11,3,.) // 3 column for lower ci, estimate, upper ci

*Average effect, all experiments
mixed poolexp i.treat_exp `controls1' `controls2a' || lfdn:
mat r=r(table)
matrix list r
matrix matrix2_all[1, 1] = r[1,4]
matrix matrix2_all[1, 2] = r[5,4]
matrix matrix2_all[1, 3] = r[6,4]
matrix list matrix2_all

*By authoritarian beliefs, all experiments
mixed poolexp i.treat_exp##c.authoritarian `controls1' `controls2b' || lfdn:
margins, dydx(4.treat_exp) at(authoritarian=(.83 .29)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_all[2, 1] = r[1,3] // authoritarianism high
matrix matrix2_all[2, 2] = r[5,3]
matrix matrix2_all[2, 3] = r[6,3]
matrix matrix2_all[3, 1] = r[1,4] // authoritarianism low
matrix matrix2_all[3, 2] = r[5,4]
matrix matrix2_all[3, 3] = r[6,4]
matrix list matrix2_all

*By conspiracy theory beliefs, all experiments
mixed poolexp i.treat_exp##c.conspiracy_sum `controls1' `controls2c' || lfdn:
margins, dydx(4.treat_exp) at(conspiracy_sum=(.8 .05)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_all[4, 1] = r[1,3] // high conspiracy theory score
matrix matrix2_all[4, 2] = r[5,3]
matrix matrix2_all[4, 3] = r[6,3]
matrix matrix2_all[5, 1] = r[1,4] // low conspiracy theory score
matrix matrix2_all[5, 2] = r[5,4]
matrix matrix2_all[5, 3] = r[6,4]
matrix list matrix2_all

*By political knowledge, all experiments
mixed poolexp i.treat_exp##c.know_sum `controls1' `controls2d' || lfdn:
margins, dydx(4.treat_exp) at(know_sum=(0 .875)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_all[6, 1] = r[1,3] // high political knowledge
matrix matrix2_all[6, 2] = r[5,3]
matrix matrix2_all[6, 3] = r[6,3]
matrix matrix2_all[7, 1] = r[1,4] // low political knowledge
matrix matrix2_all[7, 2] = r[5,4]
matrix matrix2_all[7, 3] = r[6,4]
matrix list matrix2_all

*By attitudes toward German government, all experiments
mixed poolexp i.treat_exp##c.pred_bundes_gov_r `controls1' `controls2e' || lfdn:
margins, dydx(4.treat_exp) at(pred_bundes_gov_r=(0 .9)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_all[8, 1] = r[1,3] // government opponents
matrix matrix2_all[8, 2] = r[5,3]
matrix matrix2_all[8, 3] = r[6,3]
matrix matrix2_all[9, 1] = r[1,4] // government supporters
matrix matrix2_all[9, 2] = r[5,4]
matrix matrix2_all[9, 3] = r[6,4]
matrix list matrix2_all

*By attitudes toward Russia, experiments on foreign policy
mixed poolexp i.treat_exp##c.pred_Russia_r age `controls1' `controls2f' || lfdn:
margins, dydx(4.treat_exp) at(pred_Russia_r=(.8 .0 )) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_all[10, 1] = r[1,3] // positive attitude toward Russia 
matrix matrix2_all[10, 2] = r[5,3]
matrix matrix2_all[10, 3] = r[6,3]
matrix matrix2_all[11, 1] = r[1,4] // negative attitude toward Russia  
matrix matrix2_all[11, 2] = r[5,4]
matrix matrix2_all[11, 3] = r[6,4]
matrix list matrix2_all


***************************************************

*** Section 3: Effects of Russian Frame + Sourcing

***************************************************

matrix matrix1_source_all = J(11,3,.) // 3 column for lower ci, estimate, upper ci

*Average effect, all experiments
mixed poolexp i.treat_exp `controls1' `controls2e' || lfdn:
mat r=r(table)
matrix list r
matrix matrix1_source_all[1, 1] = r[1,3]
matrix matrix1_source_all[1, 2] = r[5,3]
matrix matrix1_source_all[1, 3] = r[6,3]
matrix list matrix1_source_all

*By authoritarian beliefs, all experiments
mixed poolexp i.treat_exp##c.authoritarian `controls1' `controls2e' || lfdn:
margins, dydx(3.treat_exp) at(authoritarian=(.83 .29)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_source_all[2, 1] = r[1,3] // authoritarianism high
matrix matrix1_source_all[2, 2] = r[5,3]
matrix matrix1_source_all[2, 3] = r[6,3]
matrix matrix1_source_all[3, 1] = r[1,4] // authoritarianism low
matrix matrix1_source_all[3, 2] = r[5,4]
matrix matrix1_source_all[3, 3] = r[6,4]
matrix list matrix1_source_all

*By conspiracy theory beliefs, all experiments
mixed poolexp i.treat_exp##c.conspiracy_sum `controls1' `controls2e' || lfdn:
margins, dydx(3.treat_exp) at(conspiracy_sum=(.8 .05)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_source_all[4, 1] = r[1,3] // high conspiracy theory score
matrix matrix1_source_all[4, 2] = r[5,3]
matrix matrix1_source_all[4, 3] = r[6,3]
matrix matrix1_source_all[5, 1] = r[1,4] // low conspiracy theory score
matrix matrix1_source_all[5, 2] = r[5,4]
matrix matrix1_source_all[5, 3] = r[6,4]
matrix list matrix1_source_all

*By political knowledge, all experiments
mixed poolexp i.treat_exp##c.know_sum `controls1' `controls2e' || lfdn:
margins, dydx(3.treat_exp) at(know_sum=(0 .875)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_source_all[6, 1] = r[1,3] // high political knowledge
matrix matrix1_source_all[6, 2] = r[5,3]
matrix matrix1_source_all[6, 3] = r[6,3]
matrix matrix1_source_all[7, 1] = r[1,4] // low political knowledge
matrix matrix1_source_all[7, 2] = r[5,4]
matrix matrix1_source_all[7, 3] = r[6,4]
matrix list matrix1_source_all

*By attitudes toward German government, all experiments
mixed poolexp i.treat_exp##c.pred_bundes_gov_r `controls1' `controls2e' || lfdn:
margins, dydx(3.treat_exp) at(pred_bundes_gov_r=(0 .9)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_source_all[8, 1] = r[1,3] // government opponents
matrix matrix1_source_all[8, 2] = r[5,3]
matrix matrix1_source_all[8, 3] = r[6,3]
matrix matrix1_source_all[9, 1] = r[1,4] // government supporters
matrix matrix1_source_all[9, 2] = r[5,4]
matrix matrix1_source_all[9, 3] = r[6,4]
matrix list matrix1_source_all

*By attitudes toward Russia, experiments on foreign policy
mixed poolexp i.treat_exp##c.pred_Russia_r `controls1' `controls2e' || lfdn:
margins, dydx(3.treat_exp) at(pred_Russia_r=(.8 .0 )) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix1_source_all[10, 1] = r[1,3] // positive attitude toward Russia 
matrix matrix1_source_all[10, 2] = r[5,3]
matrix matrix1_source_all[10, 3] = r[6,3]
matrix matrix1_source_all[11, 1] = r[1,4] // negative attitude toward Russia  
matrix matrix1_source_all[11, 2] = r[5,4]
matrix matrix1_source_all[11, 3] = r[6,4]
matrix list matrix1_source_all



***************************************************

*** Section 4: Effects of Western Frame + Sourcing

***************************************************

matrix matrix2_source_all = J(11,3,.) // 3 column for lower ci, estimate, upper ci

*Average effect, all experiments
mixed poolexp i.treat_exp `controls1' `controls2e' || lfdn:
mat r=r(table)
matrix list r
matrix matrix2_source_all[1, 1] = r[1,5]
matrix matrix2_source_all[1, 2] = r[5,5]
matrix matrix2_source_all[1, 3] = r[6,5]
matrix list matrix2_source_all

*By authoritarian beliefs, all experiments
mixed poolexp i.treat_exp##c.authoritarian `controls1' `controls2e' || lfdn:
margins, dydx(5.treat_exp) at(authoritarian=(.83 .29)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_source_all[2, 1] = r[1,3] // authoritarianism high
matrix matrix2_source_all[2, 2] = r[5,3]
matrix matrix2_source_all[2, 3] = r[6,3]
matrix matrix2_source_all[3, 1] = r[1,4] // authoritarianism low
matrix matrix2_source_all[3, 2] = r[5,4]
matrix matrix2_source_all[3, 3] = r[6,4]
matrix list matrix2_source_all

*By conspiracy theory beliefs, all experiments
mixed poolexp i.treat_exp##c.conspiracy_sum `controls1' `controls2e' || lfdn:
margins, dydx(5.treat_exp) at(conspiracy_sum=(.8 .05)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_source_all[4, 1] = r[1,3] // high conspiracy theory score
matrix matrix2_source_all[4, 2] = r[5,3]
matrix matrix2_source_all[4, 3] = r[6,3]
matrix matrix2_source_all[5, 1] = r[1,4] // low conspiracy theory score
matrix matrix2_source_all[5, 2] = r[5,4]
matrix matrix2_source_all[5, 3] = r[6,4]
matrix list matrix2_source_all

*By political knowledge, all experiments
mixed poolexp i.treat_exp##c.know_sum `controls1' `controls2e' || lfdn:
margins, dydx(5.treat_exp) at(know_sum=(0 .875)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_source_all[6, 1] = r[1,3] // high political knowledge
matrix matrix2_source_all[6, 2] = r[5,3]
matrix matrix2_source_all[6, 3] = r[6,3]
matrix matrix2_source_all[7, 1] = r[1,4] // low political knowledge
matrix matrix2_source_all[7, 2] = r[5,4]
matrix matrix2_source_all[7, 3] = r[6,4]
matrix list matrix2_source_all

*By attitudes toward German government, all experiments
mixed poolexp i.treat_exp##c.pred_bundes_gov_r `controls1' `controls2e' || lfdn:
margins, dydx(5.treat_exp) at(pred_bundes_gov_r=(0 .9)) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_source_all[8, 1] = r[1,3] // government opponents
matrix matrix2_source_all[8, 2] = r[5,3]
matrix matrix2_source_all[8, 3] = r[6,3]
matrix matrix2_source_all[9, 1] = r[1,4] // government supporters
matrix matrix2_source_all[9, 2] = r[5,4]
matrix matrix2_source_all[9, 3] = r[6,4]
matrix list matrix2_source_all

*By attitudes toward Russia, experiments on foreign policy
mixed poolexp i.treat_exp##c.pred_Russia_r `controls1' `controls2e' || lfdn:
margins, dydx(5.treat_exp) at(pred_Russia_r=(.8 .0 )) // predicted for 5 and 95 percent percentile
mat r=r(table)
matrix list r
matrix matrix2_source_all[10, 1] = r[1,3] // positive attitude toward Russia 
matrix matrix2_source_all[10, 2] = r[5,3]
matrix matrix2_source_all[10, 3] = r[6,3]
matrix matrix2_source_all[11, 1] = r[1,4] // negative attitude toward Russia  
matrix matrix2_source_all[11, 2] = r[5,4]
matrix matrix2_source_all[11, 3] = r[6,4]
matrix list matrix2_source_all


***************************************************

*** Section 5: Create figure

***************************************************

coefplot  (matrix(matrix1_all[,1]), ci((matrix1_all[,2] matrix1_all[,3])))  (matrix(matrix1_source_all[,1]), ci((matrix1_source_all[,2] matrix1_source_all[,3]))), bylabel("Anti-mainstream frame;" "Russian source") ///
       || (matrix(matrix2_all[,1]), ci((matrix2_all[,2] matrix2_all[,3]))) (matrix(matrix2_source_all[,1]), ci((matrix2_source_all[,2] matrix2_source_all[,3]))), bylabel("Mainstream frame;" "Western source") ///
       ||, scheme(s1mono) drop(_cons) xline(0) ///
		headings(r2 = "By authoritarian beliefs" r4 = "By belief in conspiracy theories" r6 = "By political knowledge" r8 = "By attitude twd German government" r10 = "By attitude twd Russia ") ///
		coeflabels(r1="Total sample" r2="Strong" r3="Weak" r4="Strong" r5="Weak" r6="Low" r7="High" r8="Negative" r9="Positive" r10="Positive" r11="Negative" )  name(Fig2, replace) ///
		xscale(range(-.4 (.1) .4)) xlabel(-.4 (.1) .4) ///
		xsize(6) ysize(4) legend(off)
addplot 1: , legend(order(2 "Frame only" 4 "Frame + source") size(small)) norescaling

*capture graph export Fig2.pdf, replace
*NOTE: The position of the legend in Fig2 was edited by hand for the published paper